package com.rain.shoppingscienceproj.ui.activity;

import android.Manifest;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.rain.shoppingscienceproj.module.UserInfo;
import com.rain.shoppingscienceproj.utils.LoadingDialog;

/**
 * Author: Rain
 * Create: 2018/8/24 10:54
 */
public class BaseActivity extends AppCompatActivity {


    public UserInfo userInfo;

    public LoadingDialog loadingDialog;
    //相机权限
    public String[] permissions = {Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE};

    //电话权限
    public String[] perms = {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CALL_PHONE};


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    public void startActivitys(Class c) {
        Intent intent = new Intent(this, c);
        startActivity(intent);
    }

    public void startActivitys(Class c, Integer type) {
        Intent intent = new Intent(this, c);
        intent.putExtra("type", type);
        startActivity(intent);
    }

    public void startForActivitys(Class c, Integer type) {
        Intent intent = new Intent(this, c);
        intent.putExtra("type", type);
        startActivityForResult(intent, type);
    }

    public void startActivitys(Class c, String type) {
        Intent intent = new Intent(this, c);
        intent.putExtra("type", type);
        startActivity(intent);
    }

    public void startActivitys(Class c, String type, String id) {
        Intent intent = new Intent(this, c);
        intent.putExtra("type", type);
        intent.putExtra("id", id);
        startActivity(intent);
    }
}
